package com.dykj.fireFighting.server.socialUnit.personnelstructure.service.impl;

import com.dykj.fireFighting.api.socialUnit.personnelstructure.entity.PersonnelStructure;
import com.dykj.fireFighting.api.socialUnit.personnelstructure.service.IPersonnelStructureService;
import com.dykj.fireFighting.common.core.service.impl.BaseServiceImpl;
import com.dykj.fireFighting.server.socialUnit.personnelstructure.mapper.PersonnelStructureMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.transaction.annotation.Transactional;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 消防安全-人员架构管理
 *
 * @Author zly
 * @Date  2021-06-28 16:00:17
 */
@Slf4j
@DubboService
@Transactional(rollbackFor = Exception.class)
public class PersonnelStructureServiceImpl extends BaseServiceImpl<PersonnelStructureMapper, PersonnelStructure> implements IPersonnelStructureService {


    @Override
    public List<PersonnelStructure> selectStructureList(HashMap<String, Object> params) {
        return this.baseMapper.selectStructureList(params);
    }

    @Override
    public List<PersonnelStructure> selectListByParentId(String id) {
        return this.baseMapper.selectListByParentId(id);
    }

    @Override
    public int delete(String id) {
        PersonnelStructure personnelStructure = new PersonnelStructure();
        personnelStructure.setId(id);
        personnelStructure.setIsDel(0);
        return this.baseMapper.updateById(personnelStructure);
    }


}
